package cn.ac.siom.query.dao.impl;

import cn.ac.siom.query.dao.ITab_ThesisDao;
import cn.ac.siom.query.vo.Tab_Thesis;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.sql.SQLException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

//报告

@Repository
public class Tab_ThesisDaoImpl extends SqlSessionDaoSupport implements ITab_ThesisDao {
    @Autowired
    public Tab_ThesisDaoImpl(SqlSessionFactory sqlSessionFactory){
        super.setSqlSessionFactory(sqlSessionFactory);
    }


    @Override
    public boolean doCreate(Tab_Thesis vo) throws SQLException {
        return false;
    }

    @Override
    public boolean doUpdate(Tab_Thesis vo) throws SQLException {
        return false;
    }

    @Override
    public boolean doRemove(Set<?> ids) throws SQLException {
        return false;
    }

    @Override
    public Tab_Thesis findById(Integer i_id) throws SQLException {
        return (Tab_Thesis) super.getSqlSession().selectList("Tab_ThesisNS.findNO");
    }

    @Override
    public List<Tab_Thesis> findAll() throws SQLException {
        return super.getSqlSession().selectList("Tab_ThesisNS.findAll");
    }


    @Override
    public List<Tab_Thesis> findAllBySplit(String column, String keyWord, Integer currentPage, Integer lineSize) throws SQLException {
        return null;
    }

    @Override
    public Integer getAllCount(String column, String keyWord) throws SQLException {
        return null;
    }



    @Override
    public List<Tab_Thesis> findReport() throws SQLException {
        return super.getSqlSession().selectList("Tab_ThesisNS.findReport");
    }

    @Override
    public List<Tab_Thesis> findJournal() throws SQLException {
        return super.getSqlSession().selectList("Tab_ThesisNS.findJournal");
    }

    @Override
    public List<Tab_Thesis> findConference() throws SQLException {
        return super.getSqlSession().selectList("Tab_ThesisNS.findConference");
    }
    @Override
    public List<Tab_Thesis> findNo(Integer id) throws SQLException {
        Map<String, Integer> map= new HashMap<>();
        map.put("i_id",id);
        return super.getSqlSession().selectList("Tab_ThesisNS.findNo", map);
    }

    @Override
    public List<Tab_Thesis> findSearch(String keywords) throws SQLException {
        Map<String,String> map=new HashMap<>();
        map.put("keywords",keywords);


        return  super.getSqlSession().selectList("Tab_ThesisNS.findSearch",map);

    }
}
